<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.11.0.min.js"></script>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<title>Insert title here</title>

<script type="text/javascript" src="${pageContext.request.contextPath }/js/reset.js"></script>
		<link href="${pageContext.request.contextPath }/css/reset.css" rel="stylesheet" type="text/css" />


<script type="text/javascript">
	$(function(){

		$(function(){
			if("${hasreset}" == "1"){
				alert("修改成功");
			}
		})
	})
</script>

<!-- 取消关注的js开始 -->
<script type="text/javascript">

$(function(){
	$(".focusbutton").click(function(){
		var n = $(this).attr("id");
		
		$.ajax({
            url:"${pageContext.request.contextPath}/DeleteFocusServlet",
            async:false,
            type:"post",
            data:{'userID':"${userinfo.userID}",'beUserID':n.substring(5)},
            dataType:"json",
            success:function(d){
            	
            }
        });
		
		
		
		n = "#one" + n ;
		$(n).css("display","none");
		alert("已经取消关注!")
	})
})

</script>
<!-- 取消关注的js结束 -->

<!-- 取消收藏的js开始 -->
<script type="text/javascript">
	$(function(){
		$(".shoucbutton").click(function(){
			var n = $(this).attr("id");
			
			$.ajax({
	            url:"${pageContext.request.contextPath}/DeleteShoucServlet",
	            async:false,
	            type:"post",
	            data:{'userID':"${userinfo.userID}",'plantID':n.substring(5)},
	            dataType:"json",
	            success:function(d){
	            	
	            }
	        });
			
			
			
			n = "#one" + n ;
			$(n).css("display","none");
			alert("已经取消关注!")
		})
	})
</script>
<!-- 取消收藏的js结束 -->



</head>
<body>
<% 
	request.getSession().setAttribute("hasreset", "0");

%>
	<div class = "main1">
		<div class = "top1div" style = "">
			<span style = "color:#f4c257">
			★</span>&nbsp
			<a href = "${pageContext.request.contextPath }/login.jsp" style = "text-decoration: none;color:green;">
			个人信息
			</a>
		</div>
		<form action="${pageContext.request.contextPath }/SendResetServlet" method = "post"  enctype="multipart/form-data">
		<div class = "myinfodiv">
			<div class = "headdiv" style  = "width:170px;height:100px;">
				<div class  ="headhead" style = "width:45px;height:45px;border-radius:80px;">
					<img alt="" src="${userinfo.path }" style = "width:100%;height:100%;border-radius:80px;">
				</div>
				<div class = "resethead" style = "width:80px;height:30px;padding: 5px;margin-top:10px;font-weight:bold;margin-left: 10px;border:0px; ">
					修改头像
				</div>
				<div class = "filediv" style = "width:150px;height:20px;">
					<input type = "file" name = "img" style = "float: left;width:150px;">
				</div>
			</div>
			<div class = "userid">
				账号：
				<input type = "text" name = "userID" value = "${userinfo.userID }">
			</div>
			<div class = "username">
				用户名：
				<input type = "text" name = "userName" value = "${userinfo.userName }">
			</div>
			<div class = "sexy">
				性别：${userinfo.sexy }
				<select name = "sexy">
					<option>男</option>
					<option>女</option>
				</select>
			</div>
			<div class = "address">
				地址：
				<input type = "text"  name = "address" value = "${userinfo.address }">
			</div>
			<div class = "phonenum">
				电话：
				<input type = "text" name = "phoneNum" value = "${userinfo.phoneNum }">
			
			</div>
			<div class = "resetbutton" style = "">
				<input type = "submit" value = "点击修改" style = "margin-left:20px;margin-top:5px;width:150px;height:40px;color:green;font-weight:bold;font-size:20px;background-color: #83fa63;	">
			</div>
		</div>
		</form>
		
		
		<div class = "top1div" style = "	"> 
			<span style = "color:#f4c257"">★</span>&nbsp我的关注
		</div>
		
<!-- 		我的关注开始 -->

			<div class = "myfocusdiv" style = "width:100%;height:220px;">
			<div class = "myfocusinnerdiv" style = "width:97%;height:190px;margin: 10px;">
				<c:forEach items="${myfocus }" var = "n">
					<div class = "onefocus" id = "onefocus${n.userID }" style = "margin:10px;margin-left:20px;width:105px;height:160px;">
					<div class = "onefocusinner" style  = "padding: 10px;">
						<div class = "focushead" style = "border-radius:40px;width:80px;height:80px;">
						<img alt="" src="${n.path }" style = "border-radius:40px;">
					</div>
					<div class = "usernamediv" style = "width:100%;text-align:center;font-size: 15px;font-weight: bold;color:green;margin-top: 3px;">
						${n.userName }
					</div>
					<div class = "focusbuttondiv" style = "font-size: 12px;margin-left: 7px;margin-top:5px;">
						<input type  = "button" class = "focusbutton"  id = "focus${n.userID }" name = "focususerid" value = "取消关注" style  = "background-color: #defae5;border-radius:40px;">
					</div>
					
					</div>
				</div>
				</c:forEach>
				
			</div>
		</div>
		
		
<!-- 		我的关注结束 -->
		
		
		
		
<!-- 		我的收藏开始 -->
		<div class = "top1div" style = "	"> 
			<span style = "color:#f4c257"">★</span>&nbsp我的收藏
		</div>
		<div class = "myshoucdiv" style = "">
			<div class = "myshoucinnerdiv" style = "">
				<c:forEach items="${myshouc }" var = "n">
					<div class =  "oneshoucdiv" id = "oneshouc${n.plantID }">
					<div class = "shoucpic" style = "">
						<img alt="" src="${n.path }" style = "">
					</div>
					<div class = "shoucbuttondiv" style = "width:100%;height:30px;">
						<input type = "button" id = "shouc${n.plantID }" class =  "shoucbutton" value = "取消收藏">
					</div>
				</div>
				</c:forEach>
		
		</div>
		
		</div>
		
		
<!-- 		我的收藏结束 -->

<!-- 我的购物车开始-->
<div class = "top1div">
	<span style = "color:#f4c257"">★</span>
	&nbsp我的购物车
</div>
<div class = "mycartdiv">
	<div class = "mycartinner" style = "width:95%;height:92%;margin: 20px;overflow-y: scroll;">
		<c:forEach items="${mycart }" var = "n">
			<div class = "onecart" id = "onecart${n.flowerID }" style = "width:250px;height:360px;margin: 10px;">
				<div class = "cartpicdiv" style = "width:220px;height:220px;margin: 13px;">
					<img alt="" src="${n.path }">
				</div>
				<div class = "cartbottom" >
					<div class = "flowername">
						花卉名：${n.flowerName }
					</div>
					<div class = "buynum">
						数量：${n.buyNum }
					</div>
					<div class = "sumprice">
						总价：<b>${n.sumPrice }</b>￥
					</div>
					<div class = "deletecartdiv">
						<input type = "button" value = "删除订单"  id = "onecarts${n.flowerID }" class = "deletecartbutton" style = "color:green;font-weight: bold;border-radius:6px;background-color: #defae5;">
					</div>
				</div>
			</div>
		</c:forEach>
	</div>
</div>
<!-- 我的购物车结束 -->



	</div>
</body>

<!-- 删除购物车的js -->
<script type="text/javascript">

$(function(){
	$(".deletecartbutton").click(function(){
		var n = $(this).attr('id');
		var n1 = n.substring(8)
		var n2 = "#onecart"+n1;
		$(n2).css("display","none");
		

		$.ajax({
            url:"${pageContext.request.contextPath}/DeleteCartServlet",
            async:false,
            type:"post",
            data:{'flowerID':n1},
            dataType:"json",
            success:function(d){
            
				
            }
        });
		alert("删除成功");
		
	})
})
</script>


</html>